import request from './request'
const host = process.env.NODE_ENV === 'development'? 'http://127.0.0.1' : 'http://127.0.0.1'
const apiPrefix = `${host}/v1/admin`;
const api = {
    //菜单管理
    getMenus () {
        return request.get(`${apiPrefix}/menu/get`)
    },
    addMenu ({value,title,order}) {
        return request.post(`${apiPrefix}/menu/add`,{value,title,order})
    },
    updateMenu ({id,value,title,order}) {
        return request.put(`${apiPrefix}/menu/update`,{id,value,title,order})
    },
    deleteMenu (id) {
        return request.delete(`${apiPrefix}/menu/delete/${id}`)
    }
};

export default api;
